import request from "@/utils/service.js";
//----------------------------------电费查询---------------------------------

//查询电费所有数据
export let dianfei=()=>{
    return request({
        url:"/elefee/findAll",
        method:'GET'
    })
}
//查询电费单个数据
export let find = (ownerName) => {
    return request({
        url: "/elefee/findAll",
        method: "GET",
        params:{
            ownerName
        }
 
    })
}

//-------------------------------------电费修改-------------------------------

//修改电费金额
export let electchange=(id,eleFee)=>{
    return request({
        url:"/elefee/pay",
        method:"POST",
        data:{
            id,eleFee
        }
    })
}

//--------------------------------------电费添加-------------------------------
//电费添加
export let dianfeiadd = (ownerName,ownId,houseId,feePerson,eleFee) => {
    return request({
        url: "/elefee/add",
        method: 'POST',
        data: {
            ownerName,ownId,houseId,feePerson,eleFee
        }
    })
}
//添加里面查询所有的电费用户房屋编号
export let findAllHouse=()=>{
    return request({
        url:"/elefee/findAllHouse",
        method:"GET"
    })
}
//添加里面查询房屋编号对应的用户信息
export let selecthouse=(house)=>{
    return request({
        url:"/elefee/findOwnerByHouseId",
        method:"GET",
        params:{
            house
        }
    })
}
//--------------------------------------电费删除-------------------------------

//删除电费单个数据
export let dianfeidel=(id)=>{
    return request({
        url:"/elefee/delete/"+id,
        method:"DELETE",
    })
}


//----------------------------------停车费查询---------------------------------
//查询停车费所有数据
export let parkfei=()=>{
    return request({
        url:"/parking/findAll",
        method:'GET'
    })
}
//查询停车费单个数据
export let carfind = (ownerName) => {
    return request({
        url: "/parking/findAll?ownerName="+ownerName,
        method: "GET",
 
    })
}

//-------------------------------------停车费修改-------------------------------

//修改停车费金额
export let parkchange=(id,parkFee)=>{
    return request({
        url:"/parking/pay",
        method:"POST",
        data:{
            id,parkFee
        }
    })
}

//--------------------------------------停车费添加-------------------------------

//查询所有的车牌号
export let findparknum=()=>{
    return request({
        url:"/parking/findAllParkNum",
        method:"GET"
    })
}
//查询车牌号对应的用户信息
export let selectpark=(id)=>{
    return request({
        url:"/parking/selectOwnerByParkId?"+"id="+id,
        method:"POST"
    })
}

//添加停车费用户
export let caradd = (ownId, parkNum, carNum,parkfee) => {
    return request({
        url: "/parking/add",
        method: 'post',
        data: {
            ownId, parkNum, carNum,parkfee
        }
    })
}
//--------------------------------------停车费删除-------------------------------

//删除停车费单个数据
export let parkdel = (id) => {
    return request({
        url: "/parking/delete/"+id,
        method: "DELETE",
    })
}

